package com.kiwilss.aopdemo.ui.hilt

import com.kiwilss.aopdemo.utils.LogUtils
import javax.inject.Inject

/**
 * @author : Administrator
 * e-mail : kiwilss@163.com
 * time   : 2021/02/04
 *  desc   :
 */
class Truck @Inject constructor(val driver: Driver){
    @BindGasEngine
    @Inject
    lateinit var gasEngine: Engine

    @BindElectricEngine
    @Inject
    lateinit var electricEngine: Engine

    fun deliver() {
        gasEngine.start()
        electricEngine.start()
        LogUtils.e("Truck is delivering cargo. Driven by $driver")
        gasEngine.shutdown()
        electricEngine.shutdown()
    }

}